package com.zzf.concurrent.example.design.pattern.guarded.suspension;

import com.zzf.concurrent.example.util.TimeUtil;

/**
 * @author GaoFeng2017
 * @date 2019/9/8 10:04
 */
public class App {
    public static void main(String[] args) {

        RequestQueue<String> requestQueue = new RequestQueue<>();
        ClientThread<String> clientThread = new ClientThread<>("Bob", requestQueue);
        ServerThread<String> serverThread = new ServerThread<>(requestQueue);

        clientThread.start();
        serverThread.start();

        TimeUtil.sleep(8000);
        serverThread.shutdown();
    }
}
